package com.common.retrofit.methods;

import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.entity.result.RegisterBean;
import com.common.retrofit.service.HaiNingService;

import rx.Observable;
import rx.Subscriber;

public class ForgetSetPswMethods extends BaseMethods {

    private static ForgetSetPswMethods m_ins = null;

    public static ForgetSetPswMethods getInstance() {
        if (m_ins == null) {
            synchronized (ForgetSetPswMethods.class) {
                if (m_ins == null) {
                    m_ins = new ForgetSetPswMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "User/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }


    public void forgetPsw(Subscriber<String> subscriber,
                      String mobile,
                      String checkcode  ,String newpassword  ) {
        Observable observable = initService().forgetpwd(System.currentTimeMillis()+"",
                "388aeb2e14dd2e51a784b0d190430354",mobile,checkcode,newpassword
        );
        toSubscribe(observable, subscriber);
    }
}
